<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>HTTP请求</title>

		<script src="js/vue.js"></script>
		<script type="text/javascript" src="js/vue-resource.min.js.js" ></script>

	</head>

	<body>
		<div id="app">

			<img src="img/http.png"/>
			<br />
			<br />
			<input type="button" @click="get" value="Get请求" />  <h1>{{getInfo}}</h1>
			

		</div>

		<script>
			var getUrl = "https://wanandroid.com/wxarticle/chapters/json";
			var print = function(msg) {
				console.log(msg);
			}
			var vm = new Vue({
				el: "#app",
				data: {
					getInfo: ""
				},
				methods: {
					get(){
						this.$http.get(getUrl).then((data)=>{
							this.getInfo = data.body
						});
					}
				},
				

			});
		</script>
	</body>

</html>